package com.example.domain.convert;

import com.example.domain.dto.MenuDTO;
import com.example.domain.entity.Menu;
import com.example.domain.vo.MenuVO;
import org.mapstruct.Mapper;
import org.mapstruct.BeanMapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;

import java.util.List;

@Mapper(componentModel = "spring")
public interface MenuConvert {

    Menu toEntity(MenuDTO dto);

    MenuVO toVO(Menu entity);

    List<MenuVO> toVOList(List<Menu> list);

    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    void updateEntity(@MappingTarget Menu entity, MenuDTO dto);
} 